package com.nirvana.data;

import com.nirvana.config.PluginConfig;

public class DefPropertyData {
    private String propertyName;
    private String sourceName;
    private String comment;
    private int typeIndex;
    private int resolveIndex;

    private String resolveMethod;

    public String getPropertyName() {
        return propertyName;
    }

    public void setPropertyName(String _propertyName) {
        String propertyName = _propertyName;
        if ("def".equals(propertyName) || "type".equals(propertyName)) propertyName = "`" + propertyName + "`";
        this.propertyName = propertyName;
    }

    public String getSourceName() {
        return sourceName;
    }

    public void setSourceName(String sourceName) {
        this.sourceName = sourceName;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public int getTypeIndex() {
        return typeIndex;
    }

    public void setTypeIndex(String typeStr) {
        typeIndex = PluginConfig.getInstance().getTypeIndex(typeStr);
        resolveIndex = PluginConfig.getInstance().getResolveIndex(typeStr, resolveMethod);
    }

    public int getResolveIndex() {
        return resolveIndex;
    }

    public void setResolveMethod(String resolveMethod) {
        this.resolveMethod = resolveMethod;
    }
}
